package pt.nmfa.peste.session;

import pt.nmfa.peste.entity.*;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.framework.EntityQuery;
import java.util.Arrays;

@Name("statusScriptParmsList")
public class StatusScriptParmsList extends EntityQuery<StatusScriptParms> {

	private static final String EJBQL = "select statusScriptParms from StatusScriptParms statusScriptParms";

	private static final String[] RESTRICTIONS = {
			"lower(statusScriptParms.scriptParmName) like lower(concat(#{statusScriptParmsList.statusScriptParms.scriptParmName},'%'))",
			"lower(statusScriptParms.scriptParmValue) like lower(concat(#{statusScriptParmsList.statusScriptParms.scriptParmValue},'%'))", };

	private StatusScriptParms statusScriptParms = new StatusScriptParms();

	public StatusScriptParmsList() {
		setEjbql(EJBQL);
		setRestrictionExpressionStrings(Arrays.asList(RESTRICTIONS));
		setMaxResults(25);
	}

	public StatusScriptParms getStatusScriptParms() {
		return statusScriptParms;
	}
}
